#include <reg52.h>
#include "Delay.h"

sbit LED = P2^7 ;

char up[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
char down[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};

void LED_right(int x) // right 是从右到左流水开始
{	 
	char i;
	
	while(x)
  {
	for(i=0;i<8;i++)
	{
    P2=down[i]; //从右向左
	  Delay(50);
	 
	}  
	  
	for(i=0;i<8;i++)
	{
    P2=up[i];  // 从左向右
	 Delay(50);
	}
	x--;

	LED=1;
	
  }

}